﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Media;
using System.Windows.Media.Imaging;

namespace QQMusic.Controls
{
    public class MPlayerButton : Button
    {
        public static readonly DependencyProperty ImagePathProperty =
            DependencyProperty.Register("ImagePath", typeof(string), typeof(MPlayerButton), new PropertyMetadata(null));

        /// <summary>
        /// 图标路径
        /// </summary>
        [Description("图标路径"), Category("WzxSkin")]
        public string ImagePath
        {
            get { return (string)GetValue(ImagePathProperty); }
            set { SetValue(ImagePathProperty, value); }
        }

        public static readonly DependencyProperty MusicsProperty =
            DependencyProperty.Register("Musics", typeof(string), typeof(MPlayerButton), new PropertyMetadata(null));

        /// <summary>
        /// 音乐库数量
        /// </summary>
        [Description("音乐库数量"), Category("WzxSkin")]
        public string Musics
        {
            get { return (string)GetValue(MusicsProperty); }
            set { SetValue(MusicsProperty, value); }
        }

        private static void OnPropertyChanged(DependencyObject dependency, DependencyPropertyChangedEventArgs args)
        {
            MPlayerButton button = dependency as MPlayerButton;
            if (args.Property.Name.Equals("ImagePath"))
            {
                button.ImagePath = (string)args.NewValue;
            }
        }
    }
}
